/*
 * Operators.h
 *
 *  Created on: Mar 14, 2011
 *      Author: dwm
 */

class RelationalOp {
public:
// blocks the caller until the particular relational operator
// has run to completion
        virtual void WaitUntilDone () = 0;
// tells how much internal memory the operation can use
        virtual void Use_n_Pages (int n) = 0;
 };



class SelectPipe : public RelationalOp {
public:
	void Run (Pipe &inPipe, Pipe &outPipe, CNF &selOp, Record  &literal);
}


class SelectFile : public RelationalOp {
public:
	void Run (DBFile &inFile, Pipe &outPipe, CNF &selOp, Record &literal);
 }

class Project : public RelationalOp {
public:
	void Run (Pipe &inPipe, Pipe &outPipe, int *keepMe, int numAttsInput, int numAttsOutput);
}

class Join : public RelationalOp {
public:
	void Run (Pipe &inPipeL, Pipe &inPipeR, Pipe &outPipe, CNF &selOp, Record &literal);
 }


class DuplicateRemoval : public RelationalOp {
public:
	void Run (Pipe &inPipe, Pipe &outPipe, Schema &mySchema);
}


class Sum : public RelationalOp {
public:
	void Run (Pipe &inPipe, Pipe &outPipe, Function &computeMe);
 }

class GroupBy : public RelationalOp {
public:
	void Run (Pipe &inPipe, Pipe &outPipe, OrderMaker &groupAtts, Function &computeMe);
}

class WriteOut : public RelationalOp {
public:
	void Run (Pipe &inPipe, FILE *outFile, Schema &mySchema);
}
